package com.awesumgames.awesum;

import android.opengl.GLES20;
import android.opengl.Matrix;

public class Layer3d extends Layer {
	public Layer3d() {
	}

	@Override
	public void add(Runnable r) {
		children.add(r);
	}
	public void add(Drawable d) {
		d.layer = this;
		children.add(d);
	}

	@Override
	public void remove(Runnable r) {
		children.remove(r);
	}
	public void remove(Drawable r) {
		children.remove(r);
	}
	
	public void draw() {
		/*GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
		//float[] ortho = ortho2d(0f, 0f, Game.screenWidth, Game.screenHeight);
		//Matrix.orthoM(Game.projectionMatrix, 0, -ratio, ratio, -1, 1, -10, 10);
		Matrix.orthoM(Game.projectionMatrix, 0, 0, ratio, 0, 1, -10, 10);
		*/
		
		GLES20.glDisable(GLES20.GL_BLEND);
		GLES20.glEnable(GLES20.GL_CULL_FACE);
		GLES20.glEnable(GLES20.GL_DEPTH_TEST);
		
		Game.camera.look();
		
		Game.setProjection3d();
		
		super.draw();
	}
}
